﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Hydrogen.MathExt.Expression.Functions
{
    internal class FunctionMax : FunctionBase
    {
        public override int ArgCount => 2;

        public override double Evaluate(params double[] args)
        {
            if (args == null || args.Length == 0) return 0;
            double max = double.MinValue;
            foreach (var item in args)
            {
                if (max < item) max = item;
            }

            return max;
        }

    }
}
